package com.order.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.order.model.sys.SysRole;
import com.order.model.sys.SysRoleMenu;

public class JsonUtils {

	/**
	 * fastjson转Map
	 */
	@SuppressWarnings("unchecked")
	public static Map<String, Object> fastjson2Map(String json)
			throws UnsupportedEncodingException {
		json = URLDecoder.decode(json, "utf-8");
		return (Map<String, Object>) JSON.parse(json.substring(
				json.lastIndexOf("{"), json.indexOf("}") + 1));
	}
	
}